set oldPath=%cd%

cd /d %~dp0
if not exist .\bin\X64BuildProject md .\bin\X64BuildProject
cd .\bin\X64BuildProject\
cmake.exe ..\..\source -G "Visual Studio 14 Win64" -Wno-dev
cd /d %~dp0
echo off
if %ERRORLEVEL%==1 (
	pause
) ELSE (
	start "VS" ".//bin//X64BuildProject//GMEP.sln"
	exit
)

cd  /d %oldPath%